var link_index = 0;
setInterval(function () {
  var link_imgs = document.querySelectorAll(".link-img");
  link_index++;

  if (link_index >= 2) {
    link_index = 0;
  }
//   根据元素索引增加/移除类名 | 获取元素修改css样式 
  if (link_index == 1) {
    link_imgs[1].classList.remove("link_img_active");
    link_imgs[0].classList.add("link_img_active");
  } else if (link_index == 0) {
    link_imgs[0].classList.remove("link_img_active");
    link_imgs[1].classList.add("link_img_active");
  }

}, 2000);
